<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>问答</title>
    <link href="/styles/base.css" rel="stylesheet" type="text/css">
    <link href="/js/plugins/datepicker/datepicker.css" rel="stylesheet">
    <link href="/styles/wendaDetail.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="/js/jquery/jquery.js"></script>

    <script>
        $(function(){

            // 页面加载完毕之后, 问题浏览数加1
            $.ajax({
                url:'/community/addQuestionViewnum',
                type:'get',
                data:{questionId:'${question.id!}'}
            });

            // 提交回答按钮被点击时,发送ajax请求
            $(".btn-comment").click(function () {
                var content = $(".replyContent").val();
                $.post('/community/question/addReply',{questionId:"${question.id!}", content:content},function(data){
                    if (data.success) {
                        alert("评论成功");
                        window.location.href= "/community/question?id=${question.id!}&selectAll=true";
                    } else {
                        alert(data.msg);
                    }
                })
            });

            $(".btn_thumb").click(function () {
                var answerId = $(this).data("answerid");
                console.log(this);
                console.log(answerId);
                var answerUserId = $(this).data("answeruserid");
                //var questionId = $(this).data("questionId");
                $.get('/community/answer/thumb',{answerId:answerId, questionId:"${question.id!}",answerUserId:answerUserId},function(data){
                    if (data.success) {
                        alert("顶成功");
                        window.location.href= "/community/question?id=${question.id!}&selectAll=true";
                    } else {
                        alert(data.msg);
                    }
                })
            });

        });
    </script>
</head>

<body style="position: relative;">
  <div class="topBar">
    <div class="topBarC">
      <div class="logo"><a title="马蜂窝自由行" href="javascript:;">马蜂窝自由行</a></div>
      <div class="t_nav">
        <ul id="pnl_nav" data-cs-t="headnav_wo">
          <li data-cs-p="index">
            <strong class="t"><a href="/">首页</a></strong>
          </li>
          <li data-cs-t="wenda" data-cs-p="wenda">
            <strong class="t"><a data-cs-p="from_wo_nav" href="/community/list">问答</a></strong>
          </li>
          <li data-cs-t="things" data-cs-p="things">
            <strong class="t"><a data-cs-p="from_wo_nav" href="javascript:;">马蜂窝周边</a></strong>
          </li>
          <li data-cs-p="together">
            <strong class="t"><a href="javascript:;">结伴</a></strong>
          </li>
          <li data-cs-p="group">
            <strong class="t"><a href="javascript:;">小组</a></strong>
          </li>
          <li data-cs-p="mall">
            <strong class="t"><a href="javascript:;">蜂首俱乐部</a></strong>
          </li>
          <li class="drop" data-cs-p="other">
            <strong class="t"><a href="javascript:;">更多<b></b></a></strong>
          </li>
        </ul>
      </div>
      <div class="t_search">
        <form method="GET" action="/search/s.php" name="search">
          <input type="text" class="key" value="" name="q" id="word">
          <input type="submit" value="" class="btn">
        </form>
      </div>

      <div class="t_info">
        <div class="pagelet-block">
          <ul class="user_info">
            <li class="daka">
              <span class="daka_btn" id="_j_dakabtn" data-japp="daka">
                <a role="button" title="打卡" class="daka_before">打卡</a>
                <a role="button" title="打卡推荐" class="daka_after">打卡推荐</a>
              </span>
            </li>
            <li id="pnl_user_msg" data-hoverclass="on" class="msg _j_hoverclass">
              <span id="oldmsg" class="oldmsg"><a href="javascript:;" class="infoItem">消息<b></b></a></span>
              <ul id="head-msg-box" class="drop-bd">
                <li><a href="javascript:;" rel="nofollow">私信</a></li>
                <li><a href="javascript:;" rel="nofollow">小组消息</a></li>
                <li><a href="javascript:;" rel="nofollow">系统通知</a></li>
                <li><a href="javascript:;" rel="nofollow">问答消息</a></li>
                <li><a href="javascript:;" rel="nofollow">回复消息</a></li>
                <li><a href="javascript:;" rel="nofollow">喜欢与收藏</a></li>
                <li><a href="javascript:;" rel="nofollow">好友动态</a></li>
              </ul>
            </li>
            <li class="ub-item ub-new-msg" id="head-new-msg">
            </li>
            <li class="account _j_hoverclass" data-hoverclass="on" id="pnl_user_set">
              <span class="t"><a class="infoItem" href="javascript:;"><img
                    src="http://b2-q.mafengwo.net/s12/M00/35/B7/wKgED1uqIs-AMYTwAAAX-VIKIo0071.png?imageMogr2%2Fthumbnail%2F%2132x32r%2Fgravity%2FCenter%2Fcrop%2F%2132x32%2Fquality%2F90"
                    width="32" height="32" align="absmiddle"><b></b></a></span>
              <div class="uSet c">
                <div class="asset">
                  <a class="coin" href="javascript:;" target="_blank" rel="nofollow">蜂蜜 0</a>
                  /
                  <a class="coin" href="javascript:;" target="_blank" id="head-my-honey" rel="nofollow"
                    data-cs-p="coin">金币 579</a>
                </div>
                <a href="javascript:;">我的马蜂窝<b class="tb-level">LV.3</b></a>
                <a href="javascript:;" target="_blank">写游记</a>
                <a href="javascript:;" target="_blank">预约游记</a>
                <a href="javascript:;" target="_blank">我的足迹</a>
                <a href="javascript:;" target="_blank">我的问答</a>
                <a href="javascript:;" target="_blank">我的好友</a>
                <a href="javascript:;" target="_blank">我的收藏</a>
                <a href="javascript:;" target="_blank">我的路线</a>
                <a href="javascript:;" target="_blank">我的订单</a>
                <a href="javascript:;" target="_blank">我的优惠券</a>
                <a href="javascript:;" target="_blank">设置</a>
                <a href="javascript:;">退出</a>
              </div>
            </li>
          </ul>
        </div>
      </div>
    </div>
  </div>
  <div class="wrapper">
    <div class="detail-wrap clearfix">
      <div class="col-main">
        <div class="q-detail">
          <div class="q-content">
            <div class="q-title">

                <#--问题相关信息-->
              <a href="/wenda/area-10065.html" target="_blank" class="location"><i></i>${(question.dest.name)!}</a>
              <h1>
                <a >${question.title}</a>
              </h1>
            </div>
            <div class="q-desc">
              ${(question.content.content)!}
              <#--<div class="area_tags _j_tip_mdd" data-mddid="10065"><a data-cs-p="qa_mdd" class="at_link"
                  href="/travel-scenic-spot/mafengwo/10065.html" target="_blank">北京</a>
                <div class="at_info" style="display:none;"></div>-->
              <#--</div>通勤等于取经？上下班到底有多苦？</div>-->
            <div class="q-info1 clearfix">
              <div class="q-tags fl">
                <a class="a-tag" href="/wenda/area-10065.html" target="_blank">${(question.author.city)!}</a>
              </div>
              <div class="pub-bar fr">
                <#--<a href="/wenda/u/43303516/answer.html" class="photo" target="_blank">--> <img
                    src="${(question.author.headImgUrl)!}"
                    width="16" height="16"/></a>
                <a class="name" href="/wenda/u/43303516/answer.html" target="_blank">${(question.author.nickname)!}</a>
                <span class="time"><span>${(question.releaseTime?string("yyyy-MM-dd HH:mm:ss"))!}</span></span>
              </div>
            </div>
          </div>
          <div class="q-operate clearfix">
            <div class="fl">
              <!-- 问题分享 -->
              <div class="q-share cate-share">
                <a class="_js_showShare"><i class="q-share-icon"></i>分享</a>
                <div class="share-pop _j_share_pop hide clearfix" data-title="为什么说在北京通勤等于取经？上下班到底有多苦？"
                  data-qid="18458675">
                  <a title="分享到新浪微博" class="sina _j_do_share" data-site="wb"></a>
                  <a title="分享到QQ空间" class="zone _j_do_share" data-site="qz"></a>
                  <a title="分享到微信" class="weixin _j_do_share_wx" data-site="wx"></a>
                </div>
              </div>
              <!-- 邀请回答 -->
              <div class="seek-help _j_tip_box">
                <a class="_j_seek_help_new">邀请蜂蜂回答</a>
              </div>
              <!-- 举报 -->
              <div class="admin_hide tip-off">
                <a data-japp="report" data-refer="http://www.mafengwo.cn/wenda/detail-18458675.html"
                  data-refer-uid="43303516" data-app="qa.question" data-busi-id="qid:18458675">举报</a>
              </div>
            </div>
            <div class="fr">
                <#--查到的浏览数总是少一个,当前用户的浏览没有加进去-->
              <span class="atten-num">${(question.viewnum + 1)!}浏览</span>
              <span class="atten-num"><span class="_j_same_num">${(question.focusnum)!}</span>人关注</span>

              <a class="btn-atten _j_same_question " rel="nofollow" data-status="1"><span>关注</span></a>

              <a class="btn-answer _j_btn_goanswer" rel="nofollow">回答</a>
            </div>
          </div>
        </div>
        <div class="answer-wrap">
            <div class="hd"   >
                <a href="/community/question?id=${question.id!}&selectAll=true" <#if answers??>hidden</#if>
                   class="view_all"><#if count!=0&&count!=1>查看全部${count}个回答</#if></a>
            <#--<div style="display:none;"><span id="_j_anum">12</span>个回答</div>-->
            </div>

        <#--金牌回答者相关信息-->
        <#if goldReply??>
            <div class="bd _j_pager_box">
                <ul class="answer-list answer_detail">
                    <div>
                        <li>
                            <div class="answer-side _js_answerAva">
                                <a <#--href="/community/answer/thumb?answerId=${goldReply.id!}&answerUserId=${goldReply.userId}&questionId=${question.id}"--> class="btn-ding _js_zan btn_thumb" data-answerId='${goldReply.id!}' data-answerUserId='${goldReply.userId}' data-questionId='${question.id!}'>顶  ${goldReply.thumbnum}</a>
                            </div>
                            <div class="answer-content _js_answer_content">
                                <div class="answer-info clearfix">
                                    <div class="user-bar fl">
                                        <a class="_j_filter_click avatar" href="javascript:;" target="_blank"><img
                                                src="${(goldReply.headImgUrl)!}"
                                                width="48" height="48" class="photo"/></a>
                                        <a class="name" href="javascript:;" target="_blank">${(goldReply.username)!}</a>
                                        <a class="level" href="javascript:;" target="_blank"
                                           rel="nofollow">LV.${(goldReply.level)!}</a>
                                        <a class="identity i-guide" href="javascript:;" target="_blank">指路人</a>
                                    </div>
                                    <ul class="answer-medal fr">
                                        <li class="gold">
                                            <div class="btn"><i></i><a href="javascript:;" target="_blank">金牌回答</a>
                                            </div>
                                        </li>
                                    </ul>
                                </div>
                                <!-- 回答内容 -->
                                <div class="_j_short_answer_item hide" style="display: block;">
                                ${(goldReply.content)!}
                                </div>
                                <div class="answer-info">
                                    <span class="c-time fl">${(goldReply.releaseTime?string("yyyy-MM-dd HH:mm"))!}</span>
                                    <a class="c-reply _j_publish_reply fr">回复</a>
                                </div>
                                <#--<div class="comment-wrap _js_comments is_foldup_detail">
                                    <b class="arrow"><i></i></b>
                                    <div class="_js_comment_list">
                                        <ul class="comment-list _j_comment_list_ul">
                                            <li class="comment-item clearfix" data-cid="12360962" data-username="">
                                                <div class="comment-user">
                                                    <a href="/u/87748988.html" target="_blank"><img src="http://p1-q.mafengwo.net/s11/M00/2B/A5/wKgBEFtCSF6AOZ1XAAChSsgHiks63.jpeg?imageMogr2%2Fthumbnail%2F%2148x48r%2Fgravity%2FCenter%2Fcrop%2F%2148x48%2Fquality%2F90" class="photo"></a>
                                                </div>
                                                <dl>
                                                    <dt>
                                                        <a href="/u/87748988.html" target="_blank" class="c-name">马蜂窝用户</a>
                                                        <a href="/rank/lv.php?uid=87748988" class="level" target="_blank">LV.14</a>
                                                        : 城隍庙就是斩游客的地方，上海人都不去那里吃，小笼包皮厚的要死。那边看看，拍拍照就行了，吃还是市区查大众点评看看喜欢吃的
                                                    </dt>
                                                    <dd>
                                                        <div class="c-info">
                                                            <span class="c-time fl">2018-07-20 14:39</span>
                                                            <a class="c-reply _j_publish_reply fr">回复</a>
                                                            &lt;#&ndash;<a class="c-report fr" data-japp="report" data-refer="http://www.mafengwo.cn/wenda/detail-11783132-11793168.html" data-refer-uid="87748988" data-app="qa.answer.comment" data-busi-id="cid:12360962">举报</a>&ndash;&gt;
                                                        </div>
                                                    </dd>
                                                </dl>
                                            </li>
                                            <li class="comment-item clearfix" data-cid="12182821" data-username="">
                                                <div class="comment-user">
                                                    <a href="/u/73713094.html" target="_blank"><img src="http://p1-q.mafengwo.net/s11/M00/AB/47/wKgBEFtDwg6AEUfUAAAVbEQl0_Y21.jpeg?imageMogr2%2Fthumbnail%2F%2148x48r%2Fgravity%2FCenter%2Fcrop%2F%2148x48%2Fquality%2F90" class="photo"></a>
                                                </div>
                                                <dl>
                                                    <dt>
                                                        <a href="/u/73713094.html" target="_blank" class="c-name">楠溪</a>
                                                        <a href="/rank/lv.php?uid=73713094" class="level" target="_blank">LV.26</a>
                                                        : 真的没啥好吃的
                                                    </dt>
                                                    <dd>
                                                        <div class="c-info">
                                                            <span class="c-time fl">2018-07-10 15:32</span>
                                                            <a class="c-reply _j_publish_reply fr">回复</a>
                                                            &lt;#&ndash;<a class="c-report fr" data-japp="report" data-refer="http://www.mafengwo.cn/wenda/detail-11783132-11793168.html" data-refer-uid="73713094" data-app="qa.answer.comment" data-busi-id="cid:12182821">举报</a>&ndash;&gt;
                                                        </div>
                                                    </dd>
                                                </dl>
                                            </li>

                                        </ul>

                                    </div>
                                    &lt;#&ndash;<div class="comment-more _j_more">
                                        <a class="_js_more_comments">查看更多&gt;&gt;</a>
                                    </div>
                                    <div class="comment-page _js_comment_pagination hide" data-comment_total="25"></div>&ndash;&gt;
                                    &lt;#&ndash;<div class="comment-add clearfix _j_word">
                                        <textarea class="_j_content _j_word_check"></textarea>
                                        <span class="word-count"><span class="_j_word_num">0</span>/<span class="_j_max_num">600</span> 字</span>
                                        <input class="btn-comment _j_publish_comment" type="button" value="回复">
                                    </div>&ndash;&gt;
                                </div>-->
                            </div>
                        </li>
                    </div>
                </ul>
            </div>
        </#if>

        <#--普通回答者相关信息-->
        <#if answers??>
          <#list answers as answer>
              <div class="bd _j_pager_box">
                  <ul class="answer-list answer_detail">
                      <div>
                          <li>
                              <div class="answer-side _js_answerAva">
                                  <a class="btn-ding _js_zan btn_thumb" data-answerId='${answer.id!}' data-answerUserId='${answer.userId}' data-questionId='${question.id!}'>顶  ${answer.thumbnum}</a>
                              </div>
                              <div class="answer-content _js_answer_content">
                                  <div class="answer-info clearfix">
                                      <div class="user-bar fl">
                                          <a class="_j_filter_click avatar" href="javascript:;" target="_blank"><img
                                                  src="${(answer.headImgUrl)!}"
                                                  width="48" height="48" class="photo"></a>
                                          <a class="name" href="javascript:;" target="_blank">${(answer.username)!}</a>
                                          <a class="level" href="javascript:;" target="_blank"
                                             rel="nofollow">LV.${(answer.level)!}</a>
                                          <a class="identity i-guide" href="javascript:;" target="_blank">指路人</a>
                                      </div>
                                      <#--<ul class="answer-medal fr">
                                          <li class="gold">
                                              <div class="btn"><i></i><a href="javascript:;" target="_blank">金牌回答</a>
                                              </div>
                                          </li>
                                      </ul>-->
                                  </div>
                                  <!-- 回答内容 -->
                                  <div class="_j_short_answer_item hide" style="display: block;">
                                      ${(answer.content)!}
                                  </div>
                                  <div class="answer-info">
                                      <span class="c-time fl">${(answer.releaseTime?string("yyyy-MM-dd HH:mm"))!}</span>
                                      <a class="c-reply _j_publish_reply fr">回复</a>
                                  </div>
                              </div>
                          </li>
                      </div>
                  </ul>
              </div>
          </#list>
        </#if>
          <div class="bd _j_pager_box">
            <div class="aa-hd">
              <a class="aa-avatar" href="/wenda/u/53383161/answer.html"><img
                  src="http://n1-q.mafengwo.net/s12/M00/35/98/wKgED1uqIreAU9QZAAAXHQMBZ74008.png?imageMogr2%2Fthumbnail%2F%2148x48r%2Fgravity%2FCenter%2Fcrop%2F%2148x48%2Fquality%2F90"
                  class="photo"></a>
              <a class="aa-name">蚂蜂测试窝用户</a>
            </div>
            <div class="editor-outer _j_editorOuter _js_editorWrap _js_forFixTitle">
              <textarea class="replyContent" ></textarea>
            </div>
            <div class="aa-ft">
              <input class="btn-comment _j_submit_answer_btn" type="button" value="提交回答"/>
            </div>
          </div>
        </div>
      </div>
      <div class="col-side"></div>
    </div>
  </div>
</body>

</html>